package ncku.account.unitTest;

import static org.junit.Assert.assertEquals;

import java.util.Date;


import ncku.account.data.AbstractTransaction;
import ncku.account.data.Category;
import ncku.account.data.Transaction;

import org.junit.After;
import org.junit.Test;

public class AbstractTransactionTest {

	private Date date ; 
	private Category category;
	private AbstractTransaction abt;
	
	 @SuppressWarnings("deprecation")
	public void setUp(){
		 	date=new Date(2013, 1, 15);
		 	category=new Category("food");
	    	abt = new Transaction(date, "hi~", 100, category, null);
	    }
	    @After
	    public void tearDown(){
	    	abt = null;
	    }
	    @Test
	    public void test(){
	    	//test amount
	    	int expectedamount = 100;
	    	assertEquals(expectedamount,abt.getAmount());
	    	//test description
	    	assertEquals("hi~",abt.getDescription());
	    	//test category
	    	assertEquals("food", abt.getCategory());
	    	//test date
	    	assertEquals(date, abt.getDate());

	    }
}
